<?php
/**
 * Author: cbw
 * Desc: 客资收集配置
 * Time: 2022/4/11 11:45
 * Email: 17854288794@163.com
 */

$params = $_P['cusForm'];

$temp_other_form_arr = [];
foreach ($params as $k => $val){
    $vals_min = 1;
    $vals_max = 1;
    if ($val['mode']==4){
        $vals_min = $val['vals_min'];
        $vals_max = $val['vals_max'];
    }
    $temp_arr = [
        'name'=>$val['name'],
        'mode'=>$val['mode'],
        'vals'=>($val['vals']&& is_array($val['vals']))?$val['vals']:[],
        'vals_min'=>$vals_min,
        'vals_max'=>$vals_max
    ];
    array_push($temp_other_form_arr,$temp_arr);
}
$tempconfig = [
    'cusForm'=>$temp_other_form_arr,
    'get_open_other_form'=>1
];
$config =array_merge($config,$tempconfig);